package com.zyg.jas.studentport.service.impl;

import com.zyg.jas.common.pojo.LeaveWords;
import com.zyg.jas.studentport.dao.LeaveWordsDao;
import com.zyg.jas.studentport.service.LeaveWordsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class LeaveWordsServiceImpl implements LeaveWordsService {
    private Logger logger =  LoggerFactory.getLogger(LeaveWordsServiceImpl.class);
    @Autowired
    private LeaveWordsDao leaveWordsDao;
    @Override
    public void addWords(LeaveWords leaveWords) {
        leaveWords.setLw_date(new Date());
            this.leaveWordsDao.addLeaveWords(leaveWords);
    }

    @Override
    public List<LeaveWords> searchWords(String p_id) {
        List<LeaveWords> list = this.leaveWordsDao.searchLeaveWords(p_id);
        return list;
    }

    @Override
    public void delById(Integer id) {
        this.leaveWordsDao.deleteById(id);
    }
}
